from common.base import Base, By

class GoodsPage(Base):
    def all_index_goods(self):
        goods = self.driver.find_elements(By.CLASS_NAME, 'img-box')
        for i in range(len(goods)):
            goods[i].click()
            self.browser_back()

        indexcat = self.driver.find_elements(By.CLASS_NAME, 'cat-box')
        for i in range(len(indexcat)):
            indexcat = self.driver.find_elements(By.CLASS_NAME, 'cat-box')
            indexcat[i].click()
            imgbox = self.driver.find_elements(By.CLASS_NAME, 'img-box')
            for j in range(len(imgbox)):
                imgbox[j].click()
                self.browser_back()

            self.browser_back()
